/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validations;
import com.opensymphony.xwork2.validator.annotations.ValidatorType;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Thai Ha Cong
 */
public class Memberaccount implements Serializable {
    private Integer idMemberAccount;
    private String username;
    private String password;
    private Date openTime;
    private Date closeTime;
    private String status;
//    private Customer customer;

    public Memberaccount() {
    }

    public Memberaccount(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public Memberaccount(Integer idMemberAccount, String username, String password, Date openTime, String status) {
        this.idMemberAccount = idMemberAccount;
        this.username = username;
        this.password = password;
        this.openTime = openTime;
        this.status = status;
    }

    public Memberaccount(String username, String password, Date openTime, String status) {
        this.username = username;
        this.password = password;
        this.openTime = openTime;
        this.status = status;
    }

    public Integer getIdMemberAccount() {
        return idMemberAccount;
    }

    public void setIdMemberAccount(Integer idMemberAccount) {
        this.idMemberAccount = idMemberAccount;
    }

    public String getUsername() {
        return username;
    }

    @Validations(
            requiredStrings = {
        @RequiredStringValidator(type = ValidatorType.FIELD, message = "Username is required.")},
            stringLengthFields = {
        @StringLengthFieldValidator(type = ValidatorType.FIELD, message = "Username should be from 6 to 30 chracters.", minLength = "6", maxLength = "30")})
    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    @Validations(
            requiredStrings = {
        @RequiredStringValidator(type = ValidatorType.FIELD, message = "Password is required.")},
            stringLengthFields = {
        @StringLengthFieldValidator(type = ValidatorType.FIELD, message = "Password should be from 6 to 30 chracters.", minLength = "6", maxLength = "30")})
    public void setPassword(String password) {
        this.password = password;
    }

    public Date getOpenTime() {
        return openTime;
    }

    public void setOpenTime(Date openTime) {
        this.openTime = openTime;
    }

    public Date getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(Date closeTime) {
        this.closeTime = closeTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
    
//    public Customer getCustomer() {
//        return customer;
//    }
//
//    public void setCustomer(Customer customer) {
//        this.customer = customer;
//    }
}
